$(document).ready(function ()
{
    var floatingItem = $('.floating');
    var top = floatingItem.offset().top - parseFloat(floatingItem.css('marginTop').replace(/auto/, 0))
            - $('.menuBar').height();
    $(window).scroll(function ()
    {
        var y = $(this).scrollTop();
        if (y >= top) {
            floatingItem.addClass('fixed');
        } else {
            floatingItem.removeClass('fixed');
        }
    });
});